package com.xiaozheng.service.impl;

import com.xiaozheng.service.AccountService;

import java.util.Date;

/**
 * @Package: com.xiaozheng.coupling.service.impl
 * @ClassName: AccountServiceImpl
 * @Author: 小政同学    QQ:xiaozheng666888@qq.com
 * @CreateTime: 2020/9/19 18:10
 * @What_is_this_file_for: 业务层实现类
 * @Description: 描述
 */
public class AccountServiceImpl implements AccountService {


    //private AccountDao dao = new AccountDaoImpl();
    //private AccountDao dao = (AccountDao) BeanFactory.getBean("accountDao");

    //如果是经常变化的数据，并不适用于注入的方式
    private Integer id;
    private String name;
    private Double son;
    private Date date;

    public AccountServiceImpl(Integer id, String name, Double son, Date date) {
        this.id = id;
        this.name = name;
        this.son = son;
        this.date = date;
    }

    /**
     * 模拟保存账户
     */
    @Override
    public void saveAccountService() {
        //dao.saveAccountService();
        System.out.println("Service中的saveAccountService方法执行");
        System.out.println("AccountServiceImpl{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", son=" + son +
                ", date=" + date +
                '}');
    }

}
